#the description of qsort says that the first argument is a pointer to the first element of the array
Explore tagged Tumblr posts
Text
why is pointer stuff so weird!!! i realized out that my program wasnt doing what i wanted it to, so i put a few printfs all over the code to see where its going wrong. and it somehow fucks up the input (???) AND get a ridiculous value for the amount of lines (??????) for some input files so once it attempts to output the lines it obviously runs WAY past the right point and theres a memory leak.
#tütensuppe#before you give the array to qsort it looks alright so it def gets messed up where the pointers get passed around#but i cant figure out why!!!#the description of qsort says that the first argument is a pointer to the first element of the array#the first attempt had it point to the array itself but that didnt do anything#(i suspect because it tried to sort the pointers themselves)#so i put in the actual first element and its nothing but trouble#the amount of lines is first set in a piece of code we were given and this works fine..#but somewhere in the process it gets messed up!!#why!!!
0 notes